<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>ECharts</title>
    <script src="./js/echarts.min.js"></script>
  </head>
  <body>

    <div id="id1" style="height: 400px;;width:600px;"></div>
  
   
    <script type="text/javascript">
      // var chart = document.getElementById('id1');
      // var myChart = echarts.init(chart);

      var myChart = echarts.init(document.getElementById('id1'));

      var option = {
        title: {
          text:'大数据2032',
        },
        tooltip: {},
        legend: {},
        xAxis: {
          data:['张三','李四','王麻子']
        },
        yAxis: {},
        series: [
          {
            type:'bar',
            data:[10,15,9],
            name:'缺勤',
          }
        ]
      };
      myChart.on('click',function(params){

        console.log(params.name);

      })

      myChart.setOption(option);
 
      

    </script>
  </body>
</html>